
import java.io.IOException;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.Sprite;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Abahe
 */
public class MenuCanvas extends GameCanvas{

    MainMIDlet midlet;
    Image imgCoba;
    Sprite spBola;

    public MenuCanvas(MainMIDlet midlet){
        super(false);
        setFullScreenMode(true);
        this.midlet = midlet;
        
        try {
            
            imgCoba = Image.createImage("/zooey.png");
        } catch (IOException ex) {
            ex.printStackTrace();
        }

        
        Graphics g = getGraphics();
        drawDisplay(g);
    }

    public void drawDisplay(Graphics g){
        g.setColor(0xffffff);
        g.fillRect(0, 0, getWidth(), getHeight());
        g.setColor(0x000000);

        g.drawString("Start ", 100, 50,
                Graphics.TOP | Graphics.LEFT);
        g.drawString("High Scores ", 150, 70,
                Graphics.TOP | Graphics.LEFT);
        g.drawString("Help ", 100, 70,
                Graphics.TOP | Graphics.LEFT);
        g.drawString("About ", 100, 90,
                Graphics.TOP | Graphics.LEFT);
        g.drawString("Exit ", 100, 110,
                Graphics.TOP | Graphics.LEFT);
        
        //g.drawImage(imgCoba, getWidth() - imgCoba.getHeight(), getHeight() - imgCoba.getHeight(),
        //        Graphics.TOP | Graphics.LEFT);
    }

    protected void keyPressed(int keyCode) {
        String statusKey = String.valueOf(keyCode);
        System.out.println(statusKey);
        
        if(keyCode== -5){
            midlet.showMainGameCanvas();
        }
    }
}
